﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using DevComponents.DotNetBar;
using System.Windows.Forms;
using PMQLCHH.BUS;
using PMQLCHH.DAO;
using PMQLCHH.DTO;
using PMQLCHH.GUI;

namespace PMQLCHH
{
    public partial class DANGNHAP : DevComponents.DotNetBar.Office2007Form
    {
        //LICHNHACNHO frm_lichnhacnho = new LICHNHACNHO();

        public DANGNHAP()
        {
            InitializeComponent();
        }

        private void btn_Thoat_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btn_DangNhap_Click(object sender, EventArgs e)
        {
            if (txt_TenDangNhap.Text == "nv1" && txt_MatKhau.Text == "123456")
            {
                //Kha Nguyen - Luu ten dang nhap - 12/6/2013 - begin
                BienToanCucDTO.TenDangNhap = txt_TenDangNhap.Text;
                //Kha Nguyen - Luu ten dang nhap - 12/6/2013 - end
               // frm_lichnhacnho.ShowDialog();
                this.Close();

            }
            else
            {
                MessageBox.Show("Tên đăng nhập hoặc mật khẩu không đúng","Thông báo",MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        //Kha Nguyen - bat su kien enter - 12/6/2013 - begin
        private void txt_TenDangNhap_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                btn_DangNhap.PerformClick();
            }
        }

        private void txt_MatKhau_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                btn_DangNhap.PerformClick();
            }
        }
        //Kha Nguyen - bat su kien enter - 12/6/2013 - end
    }
}
